package com.fuqi.android.zhongcai.base.view.activity;


import android.webkit.JavascriptInterface;
import android.webkit.WebView;

import com.fuqi.android.zhongcai.R;
import com.fuqi.android.zhongcai.base.request.result.SanBaoResult;

import butterknife.Bind;

public class SanBaoDetailActivity extends BaseActivity {
//    @Bind(R.id.tv_content)
//    TextView mTview;
    @Bind(R.id.wv_content)
    WebView webview;
    private SanBaoResult data;
    @Override
    public void initView() {

    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {
        data = (SanBaoResult) getIntent().getSerializableExtra("data");
        titleBar.setTitle(data.getTitle());
//        mTview.setText(data.getDetail());
//        RichText.from(data.getDetail()).async(true).into(mTview);
        webview.getSettings().setJavaScriptEnabled(true);
        webview.addJavascriptInterface(this, "javatojs");
        webview.loadUrl("file:///android_asset/html/private.html");
    }

    @JavascriptInterface
    public String getPrivate() {
        return data.getDetail();
    }


    @Override
    public boolean hasTitleBar() {
        return true;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_san_bao_detail;
    }
}
